ticker := time.NewTicker(time.Second * 1) // 运行时长1秒
go func() {
	var x bool=true
	for x {
		select {
		case <-ticker.C:
		//代码块
		}
	}
	ticker.Stop()
}()